package aiingames.minimax;

import aiingames.minimax.State.Player;


public class Action {
	private int row;
	private int col;
	private Player p;
	
	public Action(int col, int row, Player p) {
		this.row = row;
		this.col = col;
		this.p = p;
	}
	
	public State getResult(State s) {
		int size =3;
		State ret = new State(3);
		ret.setField(new int[3][3]);
		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size; j++) {
				ret.getField()[i][j] = s.getField()[i][j];
			}
		}
		if (p == Player.MAX) {
			ret.getField()[col][row] = 1;
		} else {
			ret.getField()[col][row] = -1;
		}
		
		
		return ret;
	}
}
